﻿using PCBase.UIControls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VisionCore
{
    public class DieInfo
    {
        [Category("a.基本参数"), DisplayName("01.有效"), Description("fale：资料无效；true：资料有效；"), ReadOnly(true)]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool Enable { get; set; } = false;

        [Category("a.基本参数"), DisplayName("02.Wafer_ID"), Description("Wafer_ID")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string Wafer_ID { get; set; } = "";

        [Category("a.基本参数"), DisplayName("03.镭射内容"), Description("")]//20230203liang新增
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public LaserIniInfo laserIniInfo { get; set; } = new LaserIniInfo();

        [Category("a.基本参数"), DisplayName("05.检测开始时间"), Description("")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public DateTime StartDT { get; set; } = DateTime.Now;

        [Category("a.基本参数"), DisplayName("06.检测完成时间"), Description("")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public DateTime EndDT { get; set; } = DateTime.Now;

        [Category("b.倒膜单元"), DisplayName("01.倒膜压力根据产品数量变化功能"), Description("启用：True, 使用每个颗粒倒膜压力(N / pcs);关闭：False, 使用倒膜压力设定")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool ExcPressureByCountEnable { get; set; } = true;

        [Category("b.倒膜单元"), DisplayName("02.倒膜比例阀压力(Mpa)"), Description("单位:Mpa")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public double ExcPressureSetValu { get; set; } = 0;

        [Category("b.倒膜单元"), DisplayName("03.倒膜平台Mapping数量"), Description("单位：颗")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public uint MappingCount { get; set; } = 0;

        [Category("b.倒膜单元"), DisplayName("03.倒膜压力计压力(N)"), Description("单位:N")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public double ExcPressureMonitorValu { get; set; } = 0;

        [Category("c.镭射单元"), DisplayName("01.Laser_ID"), Description("Laser_ID")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string Laser_ID { get; set; } = "";

        [Category("c.镭射单元"), DisplayName("02.镭射启用"), Description("ON: 启用; OFF：未启用")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserEnale { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("11.Laser对位标识"), Description("ON: 对位完成; OFF：未对位")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserAlignFlag { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("12.Laser上对位结果标识"), Description("ON: 对位OK; OFF：对位NG")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserUpAlignResult { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("13.Laser侧对位结果标识"), Description("ON: 对位OK; OFF：对位NG")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserFrontAlignResult { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("14.Laser对位坐标"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public PRM_LaserPos LaserPoint { get; set; } = new PRM_LaserPos();

        [Category("c.镭射单元"), DisplayName("15.LaserOffset"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public PRM_LaserPosOffset.Laser_Point LaserOffset { get; set; } = new PRM_LaserPosOffset.Laser_Point();

        [Category("c.镭射单元"), DisplayName("21.信息组参数"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public List<BlockInfo> Blocks { get; set; } = new List<BlockInfo>();

        [Category("c.镭射单元"), DisplayName("22.Laser标识"), Description("ON: Laser完成; OFF：未Laser")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserFlag { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("31.镭射检测启用"), Description("ON: 启用; OFF：未启用")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserInspEnable { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("32.镭射功率监测值(W)"), Description("单位(W)")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public double LaserPowerMonitorValue { get; set; } = 0;

        [Category("c.镭射单元"), DisplayName("33.镭射检测抽检启用"), Description("ON: 启用; OFF：未启用")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserSpotInspEnable { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("34.Laser抽检需检测标识"), Description("ON: 需要检测; OFF：无需检测")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserSpotInspFlag { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("35.Laser检测标识"), Description("ON: 检测完成; OFF：未检测")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserInspFlag { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("36.Laser检测结果标识"), Description("ON: 检测OK; OFF：检测NG")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool LaserInspResult { get; set; } = false;

        [Category("c.镭射单元"), DisplayName("37.Laser检测结果_ID"), Description("Laser检测结果_ID")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public string LaserInsp_ID { get; set; } = "";

        [Category("d.载出移载"), DisplayName("01.拔膜检测标识"), Description("ON: 检测完成; OFF：未检测")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool ExchangeInspFlag { get; set; } = false;

        [Category("d.载出移载"), DisplayName("02.拔膜结果标识"), Description("ON: 拔膜成功; OFF：拔膜失败")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public bool ExchangeReltFlag { get; set; } = false;

        [Category("d.载出移载"), DisplayName("03.拔膜重试次数"), Description("")]
        //[EditorAttribute(typeof(CommonInputEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public int RemoveCount { get; set; } = 0;

        [Category("e.位置参数"), DisplayName("01.挑拣平台Index"), Description("1:SortST;2:SortSTNG")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public ushort SortSTIndex { get; set; } = 0;

        [Category("e.位置参数"), DisplayName("02.挑拣平台MapIndex"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public int MapIndx { get; set; } = 0;

        [Category("e.位置参数"), DisplayName("03.载入移载Index"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public int LDTRIndx { get; set; } = 0;

        [Category("e.位置参数"), DisplayName("04.镭射平台Index"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public int LaserSTIndx { get; set; } = 0;

        [Category("e.位置参数"), DisplayName("05.载出移载Index"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public int ULDTRIndx { get; set; } = 0;

        [Category("e.位置参数"), DisplayName("06.载入当前位置"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public ST_Pointr LDPos { get; set; } = new ST_Pointr();

        [Category("e.位置参数"), DisplayName("07.载出当前位置"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public ST_Point ULDPos { get; set; } = new ST_Point();

        [Category("e.位置参数"), DisplayName("08.载出移载对位Offset"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public ST_Point TRPosOffset { get; set; } = new ST_Point();

        [Category("e.位置参数"), DisplayName("09.Tray精对位Offset"), Description("")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public ST_Point TrayPosOffset { get; set; } = new ST_Point();

        public override string ToString()
        {
            return "...";
        }

        public class ST_Point
        {
            public double X { get; set; }
            public double Y { get; set; }
            public double R { get; set; }

            public ST_Point()
            {
                X = 0;
                Y = 0;
                R = 0;
            }

            public override string ToString()
            {
                return "...";
            }
        }

        public class ST_Pointr
        {
            public double X { get; set; }
            public double Y { get; set; }
            public double R { get; set; }
            public double ST_R { get; set; }

            public ST_Pointr()
            {
                X = 0;
                Y = 0;
                R = 0;
                ST_R = 0;
            }

            public override string ToString()
            {
                return "...";
            }
        }
    }
}
